<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <LINK href="style.css" rel="stylesheet" type="text/css">
   <title>Merry Mariachi</title>
   <style>
      body {
         background-image:url('chips-and-salsa.jpg');
		 background-repeat:no-repeat;
      }
   </style>
</head>

<!-- ------------------------------------------------------------------- -->
<!-- This is the calculation to determine if the player has won the game -->
<!-- Win or lose they are returned to the game menu -->
<script>
function winCalculation(){
	//generate random number
	var win = Math.floor(Math.random()*5);
	
	/////check to see if the game has been played here
	var played = false;


	/*check for losing first since it will be the most common, then if they didn't lose
	they must have won, so check if the game has been played yet. If it has, then just
	tell them they've won, if they haven't played, let them know a free desert is coming*/

	if(win != 0){
		alert("Sorry, you did not win this time.");
	}
	else if(played == true){
		alert("Congradulations! You win!");
	}
	else {
		alert("Congratulations! You have won a free dessert! The waiter will be by shortly to deliver your prize.");
		/////send an message to the waiter to deliver the coupon to the customer
	}

	/////update that the game has been played
	/////return to the game menu
}

////////////////////////////////////////////////////////////////
//include the following two functions on all screens
function help(){
	alert("A waiter is on the way to help you.");
	//send a note to the waiters that this tablet needs help
}

function refill(){
	//refill screen popup
}
////////////////////////////////////////////////////////////////
</script>
<!-- ------------------------------------------------------------------- -->

<body>
	<a href="http://students.cse.unt.edu/~npp0016/restaurant/customer/gameScreen.html">
	<button class="backButton" style="float:left">Back</button></a>
	</br>

	<h1 align="center">Merry Mariachi</h1>	
        <h3 align="center">Select one of the dancing mariachi players to see if you've won a free dessert!</h3>   

	<a href="http://students.cse.unt.edu/~npp0016/restaurant/customer/gameScreen.html">
	<table align=left>
        <tr>
            <td><img src="mariachi1.gif" onclick="winCalculation()"></td>
            <td></td>
            <td><img src="mariachi3.gif" onclick="winCalculation()"></td>
        </tr>
        <tr>
            <td></td>
            <td><img src="mariachi2_resized.gif" onclick="winCalculation()"></td>
            <td></td>
        </tr>
        <tr>
            <td><img src="mariachi3.gif" onclick="winCalculation()"></td>
            <td></td>
            <td><img src="mariachi1.gif" onclick="winCalculation()"></td>
        </tr>
	</table>
	</a>

	<div id="pageBottom">
	<button class="footerButton" onclick="help()">Help</button>
	<button class="footerButton" onclick="refill()">Refill</button>
	</div>
</body>
</html>




